package cn.china.service1.service;


import entity.Student;
import mapper.StudentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Service
public class StudentService {
    @Autowired
    StudentMapper studentMapper;


    @RequestMapping(value = "/insert",produces = "application/json;charset=utf-8")
    public int insert(@RequestBody Student student){
        return studentMapper.insert(student);
    }

    @RequestMapping(value = "/showInfo",produces = "application/json;charset=utf-8")
   public Student showInfo(){
        return new Student("tom","男","5班","123");
    }


}
